package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.po.User;
import com.foreknow.elmboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/UserController")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/getUserByIdByPass")
    public Object getUserByIdByPass(User user){

        return userService.getUserByIdByPass(user.getUserId(),user.getPassword());

    }

    @PostMapping("/saveUser")
    public Object saveUser(User user) {

        return userService.saveUser(user);
    }
}
